-
Notifications
You must be signed in to change notification settings - Fork 4
Implement model for String.equals #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/java/java/lang/String.java
Outdated
@@ -1393,8 +1393,10 @@ else if(c<=0xFFFF) | |||
* @diffblue.untested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this tagged untested
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
ce59649
to
66202de
Compare
66202de
to
c77e6a1
Compare
@@ -1611,7 +1612,7 @@ public int compareTo(String anotherString) { | |||
// DIFFBLUE MODEL LIBRARY For some reason this needs to be not null for | |||
// FileReader tests to pass. | |||
public static final Comparator<String> CASE_INSENSITIVE_ORDER | |||
= CProver.nondetWithoutNullForNotModelled(); | |||
= null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment directly above needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this change is necessary or related to this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some JBMC tests fail because the type on the left and right correspond (for jbmc). This wasn't a problem before but if we load the model of String.java for using String.equals this also gets loaded.
@@ -1611,7 +1612,7 @@ public int compareTo(String anotherString) { | |||
// DIFFBLUE MODEL LIBRARY For some reason this needs to be not null for | |||
// FileReader tests to pass. | |||
public static final Comparator<String> CASE_INSENSITIVE_ORDER | |||
= CProver.nondetWithoutNullForNotModelled(); | |||
= null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this change is necessary or related to this PR?
*/ | ||
public boolean equals(Object anObject) { | ||
// DIFFBLUE MODEL LIBRARY This is treated internally in CBMC | ||
return CProver.nondetBoolean(); | ||
if (anObject instanceof String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in the models-lib PR, could you add the original code from the JDK, commented out?
7665490
to
d6b8a38
Compare
// } | ||
// return false; | ||
|
||
// DIFFBLUE MODEL LIBRARY Use CProverString function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ In the other PR, it says "method" instead of "function".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected in the other PR
String.equals is currently handled internally by CBMC, here we update the model so that String.equals is supported when we move support to models-library.
d6b8a38
to
97aaf65
Compare
String.equals is currently handled internally by CBMC, here we update
the model so that String.equals is supported when we move support
to models-library.